<?php

// No direct access
defined ('_JEXEC') or die();

jimport ('joomla.application.component.view');

class ShipnhanhViewCurrency extends JView
{
	function display($tpl = null)
	{
		// Get data from model
		$item = $this->get('Item');
		$form = $this->get('Form');
		$isNew = $item->id < 1;
		
		// Disable main menu
		JRequest::setVar('hidemainmenu', true);
		
		// Toolbar
		if ($isNew)
		{
			JToolBarHelper::title(JText::_('COM_SHIPNHANH_SHIPNHANH_NEW_CURRENCY'), 'generic.png');
		}
		else
		{
			JToolBarHelper::title(JText::_('COM_SHIPNHANH_SHIPNHANH_EDIT_CURRENCY'), 'generic.png');
		}
		
		JToolBarHelper::apply('currency.apply');
		JToolBarHelper::save('currency.save');
		JToolBarHelper::save2new('currency.save2new');
		JToolBarHelper::cancel('currency.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
		
		$this->item = $item;
		$this->form = $form;
		
		parent::display($tpl);
		
		$document = JFactory::getDocument();
		$document->addScript(JURI::root() .
				'/administrator/components/com_shipnhanh/models/forms/validation.js');
		$document->addScript(JURI::root() .
				'/administrator/components/com_shipnhanh/models/forms/jquery_1_9.js');
	}
}